﻿using QuotingTool.DataModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuotingTool.Domain.Models
{
    public class SummaryData
    {
        public SummaryModel GetSummary(DBQuote QuoteHeader)
        {
            SummaryModel summaryModel = new SummaryModel();
            
            // Main table
            summaryModel.SDescription = "";
            summaryModel.SStartDate = QuoteHeader.Header.START_DATE;
            summaryModel.SEndDate = QuoteHeader.Header.END_DATE;
            summaryModel.SPolicyRenewal = "";
            summaryModel.SMaintenance = "";
            summaryModel.SPolicyCOL = "";
            summaryModel.SMaintenanceCost = "";
            summaryModel.SPrePaidMultiDiscount = "";
            summaryModel.SAnnualMaintPriceInclCOL = QuoteHeader.Header.ACV;
            summaryModel.SProratedMaintPriceInclCOL = QuoteHeader.Header.TOTAL_AMOUNT;
            summaryModel.SFinalMaintenanceCost = "";
            summaryModel.SCurrency = QuoteHeader.Header.CURRENCY_CODE;
           

            // Header top left
            summaryModel.EndCustomerName = QuoteHeader.Header.INSTALLED_AT_CUSTOMER_NAME;
            summaryModel.PartnerName = QuoteHeader.Header.SOLD_TO_CUSTOMER_NAME;

            // Header top right
            summaryModel.DateApproved = QuoteHeader.Header.DATE_APPROVED;
            summaryModel.QuoteNumber = QuoteHeader.Header.QUOTE_NUMBER;

            // Title 
            summaryModel.CompanyName = "";
            summaryModel.SOneLineDiscount = QuoteHeader.Header.ONE_LINE_DISCOUNT + " " + (QuoteHeader.Header.ONE_LINE_DISCOUNT_TYPE == "PCT" ? "%" : "Amount");
            summaryModel.QuoteOwner = QuoteHeader.Header.QUOTE_OWNER;
            summaryModel.SPrePaidMultiDiscount =  QuoteHeader.Header.MULTI_YEAR_INCENTIVE!="" ?(QuoteHeader.Header.MULTI_YEAR_INCENTIVE+" %"):"" ; 
            return summaryModel;
        }
    }
}
